---
layout: "default"
title: "DictionaryIndex"
description: "Swift documentation for 'DictionaryIndex': Used to access the key-value pairs in an instance of."
keywords: "DictionaryIndex,struct,swift,documentation,successor"
root: "/v1.2"
---

<div class="intro-declaration"><code class="language-swift">struct DictionaryIndex&lt;Key : Hashable, Value&gt;</code></div>

<div class="discussion comment">
    <p>Used to access the key-value pairs in an instance of
<code>Dictionary&lt;Key, Value&gt;</code>.</p>

<p>Dictionary has two subscripting interfaces:</p>

<ol><li><p>Subscripting with a key, yielding an optional value:</p><p> v = d[k]!</p></li><li><p>Subscripting with an index, yielding a key-value pair:</p><p> (k,v) = d[i]</p></li></ol>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<code class="inherits">Comparable, Equatable, ForwardIndexType, _Comparable, _ForwardIndexType, _Incrementable</code>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>



<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>







<h3>Instance Methods</h3>
<div class="declaration" id="func-successor">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-successor">func successor()</a>
        
<div class="comment collapse" id="comment-func-successor"><div class="p">
    <p>Returns the next consecutive value after <code>self</code>.</p>

<p>Requires: the next value is representable.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func successor() -&gt; DictionaryIndex&lt;Key, Value&gt;</code>
    
    
</div></div>
</div>


